/**
 * MineAdmin is committed to providing solutions for quickly building web applications
 * Please view the LICENSE file that was distributed with this source code,
 * For the full copyright and license information.
 * Thank you very much for using MineAdmin.
 *
 * @Author X.Mo<root@imoi.cn>
 * @Link   https://github.com/mineadmin
 */
import type { MaFormItem } from "@mineadmin/form";
import hasAuth from "@/utils/permission/hasAuth.ts";
import MaDictRadio from "@/components/ma-dict-picker/ma-dict-radio.vue";
import { concat } from "lodash-es";
import { rdOrganizeZoneStatusDictData } from "./common.tsx";

export default function getFormItems(
  formType: "add" | "edit" = "add",
  t: any,
  model: any
): MaFormItem[] {
  return concat([
    {
      label: "大区名称",
      prop: "name",
      render: "input",
      renderProps: { placeholder: t("form.pleaseInput", { msg: "大区名称" }) },
      itemProps: { rules: [{ required: true, message: "请输入大区名称" }] },
    },
    {
      label: "状态",
      prop: "status",
      render: () => MaDictRadio,
      renderProps: { multiple: false, data: rdOrganizeZoneStatusDictData() },
      itemProps: { rules: [{ required: true, message: "请输入状态" }] },
      defaultValue: 1,
    },
  ]);
}
